home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
goldplay.zip
/
PLAY.ASM
< prev
next >
Wrap
Assembly Source File
|
1992-07-17
|
5KB
|
132 lines
╓────────────────────────────────────────────────────────────────────────────╖ Comment &
║ GoldPlay ver 1.00 ║
║────────────────────────────────────────────────────────────────────────────║
║ Programmed by : ║
║ Sourcer of The CodeBlasters ║
║ ║
║ ß-tested and bugfixed by : ║
║ Robban of The SkyHawks ║
╙────────────────────────────────────────────────────────────────────────────╜ &
Assume Cs:_Code, Ds:_Data
─────────────────────────────────────────────────────────────────────────────
_Stack Segment Para Stack 'Stack'
db 512 dup (?)
_Stack EndS
─────────────────────────────────────────────────────────────────────────────
; The Externals
─────────────────────────────────────────────────────────────────────────────
Procedures:
EXTRN INITIALIZE:FAR ; Initializes the modplayer for given
; sounddevice and replayrate
EXTRN LOADMODULE:FAR ; Loads the Module into memory
EXTRN STARTPLAYING:FAR ; Starts playing the module
EXTRN STOPPLAYING:FAR ; Stops playing the module
EXTRN DEALLOC:FAR ; Deallocates and erases the module
; from memory
EXTRN ASKINIT:FAR
Variables:
EXTRN SOUNDDEVICE:WORD ; The Sounddevice number
EXTRN TIMERSPEED:WORD ; The replayrate 1193182/Hertz
EXTRN SBDMA:WORD ; SoundBlaster's DMA-Channel
EXTRN SBIRQNR:WORD ; SoundBlaster's IRQ-Number
Special_Variables:
EXTRN BAR1,BAR2,BAR3,BAR4:WORD ; Selfdecrementing Bars, see the docs
EXTRN SHOWPATTERNS:Word ; Shows the patterns
EXTRN MASTERVOLUME:Word ; Mastervolume from 0 to 64
─────────────────────────────────────────────────────────────────────────────
_Data Segment Para Public 'Data'
Filename db 'Digital.mod',0
Error1 Db 13,10,10,7,'Module not found',13,10,'$'
PlayMess Db 13,10,10,'Playing . . .',13,10
Db 'Press ESCAPE to quit$'
_Data EndS
─────────────────────────────────────────────────────────────────────────────
_Code Segment Para Public 'Code'
Proc Player Near
Mov Ah,4Ah ; Reduce program memory size
Mov Bx,40000/16 ; Approx. size of compiled EXEFILE / 16 + 2
Int 21h
Mov Ax,_Data
Mov Ds,Ax
Call Askinit ; Ask for the setup
Call Initialize ; Initialize the SoundSystem
Mov Dx,Offset FileName
Call Loadmodule ; Load the module
Jnc NoError
Mov Ah,09h
Lea Dx,Error1
Int 21h ; Print the error-message
Mov Ah,4Ch
Int 21h ; Exit if error...
NoError:
Mov Ah,09h
Lea Dx,PlayMess
Int 21h ; Show the PLAYING-Message
Call StartPlaying ; Roll it !
Mov Al,01111010b ; Mask off all unneccesary interrupts.
Out 21h,Al
WaitEsc:
In Al,60h
Cmp Al,1
Jne WaitEsc ; Wait until someone presses ESCAPE.
Mov Al,0 ; Let the interrupts come again...
Out 21h,Al
Call StopPlaying ; Stop the funky music
Call DeAlloc ; Deallocate the memory for the module
Mov Ah,4Ch
Int 21h ; Exit to DOS
EndP Player
_Code EndS
─────────────────────────────────────────────────────────────────────────────
End Player
╓────────────────────────────────────────────────────────────────────────────╖
║ The Sounddevices: ║
║────────────────────────────────────────────────────────────────────────────║
║ 01 Soundplayer/Covox at LPT1 (Mono) ║
║ 02 Soundplayer/Covox at LPT2 (Mono) ║
║ 03 SoundBlaster (Mono) ║
║ 04 Internal Honker (Mono) ║
║ 05 Two Soundplayers LPT1+2 (Stereo) ║
║ 06 SoundBlaster Pro (Stereo) ║
║ 07 Stereo SoundPlayer in LPT1 (Stereo) ║
║ 08 Stereo SoundPlayer in LPT2 (Stereo) ║
╙────────────────────────────────────────────────────────────────────────────╜